Conversation
thedavidchu
left a comment
There was a problem hiding this comment.
Hi Jason, just leaving some comments!
| import time | ||
|
|
||
| img_pth = '/Users/jasonyuan/Desktop/Test9.png' | ||
| img_pth = '/Users/jasonyuan/Desktop/Test2.png' |
There was a problem hiding this comment.
Please upload your test images so that we can run it out of the box!
If you know the path relative to the script, but not the cwd, then this may help
| y_width = abs(sorted_points_y[-1][0] - sorted_points_y[0][0]) | ||
|
|
||
| if (x_width < 15) or (y_width < 15): # Hard-coded parameter, update maybe | ||
| if (y_width < 15) or ((x_width < 15) and (y_width < 15)): # Hard-coded parameter, update maybe |
There was a problem hiding this comment.
We don't need the outer brackets
| y_width = abs(sorted_points_y[-1][0] - sorted_points_y[0][0]) | ||
|
|
||
| if (x_width < 15) or (y_width < 15): # Hard-coded parameter, update maybe | ||
| if (y_width < 15) or ((x_width < 15) and (y_width < 15)): # Hard-coded parameter, update maybe |
There was a problem hiding this comment.
We don't need the outer brackets
|
|
||
| if (x_width < 15) or (y_width < 15): # Hard-coded parameter, update maybe | ||
| if (y_width < 15) or ((x_width < 15) and (y_width < 15)): # Hard-coded parameter, update maybe | ||
| print(y_width) |
There was a problem hiding this comment.
Do we still need the print statements?
|
|
||
| if (x_width < 15) or (y_width < 15): # Hard-coded parameter, update maybe | ||
| if (y_width < 15) or ((x_width < 15) and (y_width < 15)): # Hard-coded parameter, update maybe | ||
| print(y_width) |
There was a problem hiding this comment.
Do we still need the print statements?
| print(x_width) | ||
| return [[],[]] | ||
|
|
||
| # print(sorted_points) |
| tck,u = interpolate.splprep([x,y],k=3,s=32) | ||
| # print(u) | ||
| u = np.linspace(u[0]-0.25,u[-1]+0.25,500) | ||
| # print(tck) |
| tck,u = interpolate.splprep([x,y],k=3,s=32) | ||
| # print(u) | ||
| u = np.linspace(u[0]-0.25,u[-1]+0.25,500) | ||
| # print(tck) |
| import cv2 | ||
| import numpy as np | ||
|
|
||
| def project_2D_to_3D_camera(x_array, y_array, depth_to_y_map, f_x, f_y, o_x, o_y): |
There was a problem hiding this comment.
Nit: if you could add type hints to these, that would be amazing! tbh idk if this is rly necessary if you just call it all in a specific pipeline and don't expect anyone else to use it.
| import cv2 | ||
| import numpy as np | ||
|
|
||
| def project_2D_to_3D_camera(x_array, y_array, depth_to_y_map, f_x, f_y, o_x, o_y): |
There was a problem hiding this comment.
Nit: if you could add type hints to these, that would be amazing! tbh idk if this is rly necessary if you just call it all in a specific pipeline
No description provided.